package com.study.pattern.observer;


public class CheerLeaderGroup {
	
	MemberManagement memberManageMent = new MemberManagement();
	
	public void startChant(){
		for(int i=0;i<3;i++){
			startThread();
		}
	}

	private void startThread() {
		LadyRunnable lady = LadyRunnable.newInstance();
		memberManageMent.registerMember(lady);
		Thread ladyThread = new Thread(lady);
		ladyThread.start();
	}
	
	public void destroyThread(){
		memberManageMent.terminateLady();
	}
	
	public void updateChant(long interval, String msg){
		memberManageMent.notifyUpdate(interval, msg);
	}
	
}
